package com.arpa.wms.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import java.math.BigDecimal;
import java.util.List;


/**
 * <p>
 * 打包任务
 * </p>
 *
 * @author LEO
 * @since 2020-08-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("wms_pack_task")
@ApiModel(value="PackTask对象", description="打包任务")
public class PackTask extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "打包任务单号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "仓库")
    @TableField("warehouse_code")
    private String warehouseCode;

    @ApiModelProperty(value = "仓库名称")
    @TableField("warehouse_name")
    private String warehouseName;

    @ApiModelProperty(value = "入驻商")
    @TableField("shipment_code")
    private String shipmentCode;

    @ApiModelProperty(value = "入驻商")
    @TableField("shipment_name")
    private String shipmentName;

    @ApiModelProperty(value = "所属机构")
    @TableField("group_code")
    private String groupCode;

    @ApiModelProperty(value = "单据类型,normal：普通打包，prepackaged预打包")
    @TableField("order_type")
    private String orderType;

    @ApiModelProperty(value = "作业类型 pack:打包，paste:贴单，pack_paste:打包和贴单")
    @TableField("job_type")
    private String jobType;

    /**
     * 承运商编码
     */
    @ApiModelProperty(value = "承运商编码")
    @TableField("carrier_code")
    private String carrierCode;

    /**
     * 承运商名称
     */
    @ApiModelProperty(value = "承运商名称")
    @TableField("carrier_name")
    private String carrierName;

    @ApiModelProperty(value = "订单数量")
    @TableField("order_quantity")
    private Integer orderQuantity;

    @ApiModelProperty(value = "商品数量")
    @TableField("goods_quantity")
    private BigDecimal goodsQuantity;

    @ApiModelProperty(value = "计费方式:days天, hours工时, pieces件")
    @TableField("billing_method")
    private String billingMethod;


    @ApiModelProperty(value = "计费单价")
    @TableField("billing_price")
    private BigDecimal billingPrice;

    @ApiModelProperty(value = "作业人标识")
    @TableField("party_code")
    private String partyCode;

    @ApiModelProperty(value = "作业人名称")
    @TableField("staff_name")
    private String staffName;

    @ApiModelProperty(value = "完成时间")
    @TableField("gmt_finish")
    private String gmtFinish;

    @ApiModelProperty(value = "是否生成费用 0-否，1-是")
    @TableField("is_gen_costs")
    private Integer genCosts;

    @ApiModelProperty(value = "状态：waiting待打，completed打包完成")
    @TableField("status")
    private String status;

    @ApiModelProperty(value = "版本号")
    @TableField("version")
    @Version
    private Integer version;

    @ApiModelProperty(value = "包裹数量")
    @TableField("package_quantity")
    private Integer packageQuantity;

    @ApiModelProperty(value = "已打包包裹总数")
    @TableField("pack_quantity")
    private Integer packQuantity;


    @ApiModelProperty(value = "预打包单号")
    @TableField("prepackaged_code")
    private String prepackagedCode;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    @Length(max = 100, message = "备注长度不能大于100个字符", groups = {PackTask.Save.class, PackTask.Update.class})
    private String remarks;

    @ApiModelProperty(value = "奖励金额")
    @TableField("reward_amount")
    @Digits(integer = 20,fraction = 2, groups = {Save.class, Update.class})
    private BigDecimal rewardAmount;

    @ApiModelProperty(value = "惩罚金额")
    @TableField("punish_amount")
    @Digits(integer = 20,fraction = 2, groups = {Save.class, Update.class})
    private BigDecimal punishAmount;

    @ApiModelProperty(value = "打包任务code集合")
    @TableField(exist = false)
    private List<String> packTaskCodes;

    public interface Save{}
    public interface Update{}




}
